import { Modal ,Button} from 'antd';
import React from 'react';
import './Modal1.css'

function Modal1(props) {
    // 查看模态框默认隐藏
    const [visible, setVisible] = React.useState(false);
    // 点击查看模态框出现
    const showModal = () => {
        setVisible(true);
    };
    // 点击确认模态框消失
    const handleOk = () => {
        setVisible(false);
    };

    //   点击取消模态框消失
    const handleCancel = () => {
        setVisible(false);
    };
    return (
        <>
            <Button type="link" onClick={showModal}>
                查看
            </Button>
            {/* 第一个模态框 */}
            <Modal
                height="100"
                title="查看"
                visible={visible}
                onCancel={handleCancel}
                footer={[
                    <Button onClick={handleOk}>确认</Button>,
                    <Button onClick={handleCancel}>取消</Button>
                ]}
            >
                <div className="modal1">
                    <div className="modal1-1">
                        <p>取消原因</p>
                        <p>创建时间</p>
                        <p>状态</p>
                    </div>
                    <div className="modal1-2">
                        <p>{props.name.cancelReason}</p>
                        <p>{props.name.orderTime}</p>
                        <p>{props.name.orderState}</p>
                    </div>
                </div>
            </Modal>
        </>
    )
}
export default Modal1;